package main

import (
	"encoding/json"
	"fmt"
)

func main() {
	var stu = Student{1, "呵呵"}
	jsonStrBytes, err := json.Marshal(stu)
	if err != nil {
		fmt.Println("转换错误")
	}
	fmt.Println("json=", string(jsonStrBytes))
}

type Student struct {
	Id   int32  `json:"id"`
	Name string `json:"name"`
}
